fix(dev-dx): wasm sqlite fallback, silence PORT warning, dev auth Origin (#1875)#1898
Merged
Conversation
…gin (#1875) Three dev-DX fixes surfaced while runtime-testing templates: 1. SQLite ABI mismatch: dev now falls back native better-sqlite3 → wasm SQLite → in-memory. When the native binary's ABI doesn't match the running Node (e.g. Node 25 NODE_MODULE_VERSION mismatch), dev keeps real SQL + persistence via SqliteWasmDriver instead of dropping to the non-persistent mingo in-memory driver. 2. PORT warning: add a `{ silent: true }` option to readEnvWithDeprecation and use it at the OS_PORT/PORT call sites. PORT is an industry-standard alias that PaaS platforms inject automatically, so warning nagged operators about env they never set. Other legacy vars still warn. 3. Auth Origin 403: in dev, when a request has neither Origin nor Referer, handleRequest synthesizes a same-origin Origin from the request URL so better-auth's CSRF check passes for non-browser clients (curl/scripts). Production is untouched (gated on NODE_ENV). Tests: types 7/7, plugin-auth 118/118 (4 new Origin cases + silent option), cli 322/322; full turbo build (tsc typecheck) passes. Closes #1875 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three dev-DX fixes from #1875, surfaced while runtime-testing templates on Node 25.
better-sqlite3→ wasm SQLite → in-memory. When the native binary's ABI doesn't match the running Node (e.g. Node 25NODE_MODULE_VERSIONmismatch), dev keeps real SQL + persistence viaSqliteWasmDriverinstead of dropping to the non-persistent mingo in-memory driver. Same probe-by-connect()so load failures are caught at registration.{ silent: true }option toreadEnvWithDeprecation, applied at theOS_PORT/PORTcall sites.PORTis an industry-standard alias PaaS platforms inject automatically, so the warning nagged operators about env they never set. Other legacy vars still warn.NODE_ENV !== 'production'), when a request has neitherOriginnorReferer,handleRequestsynthesizes a same-originOriginfrom the request URL so better-auth's CSRF check passes for non-browser clients (curl/scripts). Production untouched.Test
tsctypecheck.@objectstack/types7/7,@objectstack/plugin-auth118/118 (4 new Origin-injection cases),@objectstack/cli322/322.Closes #1875
🤖 Generated with Claude Code